package IC.Parser;

public class LexicalError extends Exception
{
	private static final long serialVersionUID = 308384803468527149L;
	
	private int m_Line;

	
    public LexicalError(String message) 
	{
		this(message, -1);
		
    }

    public LexicalError(String message, int line) 
	{
    	super(message);
    	
		m_Line = line + 1;
    }
	
    @Override
	public String toString()
	{
		return m_Line == -1 ? getMessage()
							: String.format("%d: %s", m_Line, getMessage());
	}
	
	public int getLine()
	{
		return m_Line;
	}
}

